<template>
    <view>
        <!--
<view class="news">
          <view class="newslist" wx:for="{{notelist}}">
                            <view class="title">
                                     

                                       <view class="detail">
                                       
                                           <view class="info">
                                            <view>{{item.name}} </view>
                                            <view> {{item.sex == 1 ? '男' : '女'}} / {{item.age}}岁 / {{item.education}} / {{item.express}} </view>

                                            <view class="jobmoney">派遣公司: <text> {{item.companyname}}</text></view>
                                            <view class="jobmoney">面试职位: <text> {{item.jobtitle}}</text></view>

                                            
                                            <view class="jobmoney">佣金: <text> {{item.money}}</text></view>

                                            <view class="jobmoney">相关任务: <text> {{item.tasktitle}}</text></view>

                                            <view class="jobmoney">当前状态: <text> {{item.status == 0 ?'等待面试':''}}</text></view>
                                            </view>

                                            <view class="pic">
                                           <image src="{{item.avatarUrl}}"></image>

                                        

                                           <text class="time">{{item.refreshtime}}</text>

                                           <image src="../../imgs/icon/{{item.sex == 1 ? 'man' : 'sex'}}.png" class="footimg" style="width:30rpx;height:30rpx;"></image>

                                           </view>


                                        

                                      </view>


                  <view class="payitem">

             
                    <view bindtap='toInvite' data-id="{{item.id}}" wx:if="{{item.status == 0 }}">查看进度</view>
                    </view>

                            </view>
                </view>









</view>
-->

        <view class="container_2">
            <view class="navlist" style="padding-top: 30rpx">
                <view class="lists">
                    <view :class="'item ' + (status == -1 ? 'bred' : 'nobred')" @tap="toEdu" data-id="-1">全部({{ totalcount }})</view>
                    <view :class="'item  ' + (status == 0 ? 'bred' : 'nobred')" @tap="toEdu" data-id="0">新派遣({{ totalcount_0 }})</view>
                    <view :class="'item  ' + (status == 1 ? 'bred' : 'nobred')" @tap="toEdu" data-id="1">面试({{ totalcount_1 }})</view>
                    <view :class="'item  ' + (status == 2 ? 'bred' : 'nobred')" @tap="toEdu" data-id="2">录用({{ totalcount_1 }})</view>
                    <view :class="'item  ' + (status == 3 ? 'bred' : 'nobred')" @tap="toEdu" data-id="3">试用({{ totalcount_2 }})</view>
                    <view :class="'item  ' + (status == 4 ? 'bred' : 'nobred')" @tap="toEdu" data-id="4">已完成({{ totalcount_3 }})</view>
                </view>
            </view>

            <!-- 列表 -->
            <view class="news">
                <view class="guestlist" v-for="(item, index) in notelist" :key="index">
                    <view class="newslist">
                        <view class="title" @tap="toNotedetail" :data-id="item.noteid">
                            <view class="detail">
                                <view class="info">
                                    <view>{{ item.name }}</view>
                                    <view>{{ item.sex == 1 ? '男' : '女' }} / {{ item.age }}岁 / {{ item.education }} / {{ item.express }}</view>
                                    <view class="jobmoney">
                                        关联任务:
                                        <text>{{ item.tasktitle }}</text>
                                    </view>
                                </view>

                                <view class="pic">
                                    <image :src="item.avatarUrl"></image>

                                    <text class="time">{{ item.refreshtime }}</text>

                                    <image :src="'../../imgs/icon/' + (item.sex == 1 ? 'man' : 'sex') + '.png'" class="footimg" style="width: 30rpx; height: 30rpx"></image>
                                </view>
                            </view>
                        </view>
                    </view>

                    <view class="usertel">向【{{ item.companyname }}】职位【{{ item.jobtitle }}】派遣</view>

                    <view class="useraddress">
                        <view>{{ item.content }}</view>
                        <view>佣金￥ {{ item.money }}</view>
                    </view>

                    <view class="useroper">
                        <view>状态:{{ item.status }}</view>

                        <view @tap="toWorkerDetail" :data-id="item.noteid">查看求职者</view>
                        <view @tap="toGuestDetail" :data-id="item.id">进度处理</view>
                    </view>
                </view>
            </view>
        </view>

        <!-- 加载更多 -->
        <view class="loadmore">
            <text>{{ loadMore }}</text>
        </view>
    </view>
</template>

<script>
import { Company } from '../../model/company-model.js';
var company = new Company();
export default {
    data() {
        return {
            notelist: '',
            totalcount: '',
            totalcount_0: '',
            totalcount_1: '',
            totalcount_2: '',
            totalcount_3: '',
            totalcount_4: '',
            status: '',
            loadMore: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        this.onLoadClone3389(options);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        /**
         * 生命周期函数--监听页面加载
         */
        onLoadClone3389: function (options) {
            var that = this;
            uni.setNavigationBarTitle({
                title: '派遣订单'
            });
            var params = {};
            company.mysendorder((data) => {
                that.setData({
                    notelist: data.notelist,
                    totalcount: data.totalcount,
                    totalcount_0: data.totalcount_0,
                    totalcount_1: data.totalcount_1,
                    totalcount_2: data.totalcount_2,
                    totalcount_3: data.totalcount_3,
                    totalcount_4: data.totalcount_4
                });
            }, params);
        },

        toGuestDetail: function (e) {
            var id = e.currentTarget.dataset.id;
            uni.navigateTo({
                url: '/pages/sendorderdetail/index?id=' + id
            });
        },

        toWorkerDetail: function (e) {
            var id = e.currentTarget.dataset.id;
            uni.navigateTo({
                url: '/pages/workerdetail/index?id=' + id
            });
        },

        toInvite: function (e) {
            var that = this;
            var id = e.currentTarget.dataset.id;
            uni.showModal({
                title: '邀请面试',
                content: '确认邀请面试？',
                success: function (res) {
                    if (res.confirm) {
                        company.checkLogin(() => {
                            var companyid = uni.getStorageSync('companyid');
                            var params = {
                                companyid: companyid,
                                id: id
                            };
                            company.Invitenote((data) => {
                                if (data.status == 0) {
                                    uni.showModal({
                                        title: '提示',
                                        content: data.msg,
                                        showCancel: false,
                                        success: function () {
                                            that.onLoadClone3389({});
                                        }
                                    });
                                    return;
                                } else {
                                    uni.showModal({
                                        title: '提示',
                                        content: data.msg,
                                        showCancel: false
                                    });
                                    return;
                                }
                            }, params);
                        });
                    }
                }
            });
        },

        toEdu() {
            console.log('占位：函数 toEdu 未声明');
        },

        toNotedetail() {
            console.log('占位：函数 toNotedetail 未声明');
        }
    }
};
</script>
<style>
@import '../templates/css/index_2.css'; /* search */
/**app.wxss**/
page {
    background-size: 100% 100%;
    height: 100%;
    font-size: 32rpx;
    font-family: '微软雅黑', '方正黑体';
    color: #333;
}

.container_2 {
    background-color: #f0f1f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/*
.search image {
	width: 30rpx;
	height: 34rpx;
	padding-right: 3px;
	vertical-align: sub;
}

.search text {
	line-height: 30px;
	font-size: 14px;
	color: #e62129;
}

.search_box {
	display: flex;
	flex: 1;
	height: 30px;
	padding-left: 15px;
	margin: 10px 0 0 10px;
	background-color: #f7f7f7;
}

.search_box icon {
	padding-top: 8px;
}

.search_box text {
	flex: 1;
	padding-left: 5px;
	color: #999;
}

*/

.header_2 {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    padding-top: 30rpx;
    padding-bottom: 30rpx;
    background: #fff;
}
.header_2_fixed {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    padding-top: 30rpx;
    padding-bottom: 30rpx;
    background: #fff;
    position: fixed;
    z-index: 100;
    top: 0px;
}

.navlist {
    width: 100%;
    background-color: #fff;
    padding: 10rpx;
}

.lists {
    width: 720rpx;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.lists .item {
    width: 110rpx;
    height: 50rpx;
    background: #fff;
    border-radius: 10rpx;
    margin-bottom: 20rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    margin-right: 10rpx;
}

.city_2 {
    height: 80rpx;
    line-height: 80rpx;
    color: #000000;
    font-size: 0.9rem;
    font-weight: 600;
}
.search_2 {
    width: 500rpx;
    height: 80rpx;
    line-height: 80rpx;
    background: #f0f1f5;
    display: flex;
    flex-direction: row;
    justify-content: center;
    border-radius: 30rpx 30rpx 30rpx 0rpx;
}
.search_2 view {
    color: #a6a6a6;
    font-size: 0.7rem;
    align-self: center;
}
.search_2 icon {
    margin-right: 20rpx;
    margin-top: 18rpx;
}

.selectcars {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding: 20rpx;
    font-size: 0.8rem;
    background: #ffffff;
}
.selectcars_fixed {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding: 20rpx;
    font-size: 0.8rem;

    z-index: 1112;
    position: fixed;
    top: 120rpx;
    background: #fff;
}

.itemselectcars {
    display: flex;
    flex-direction: row;
    height: 60rpx;
    justify-content: center;
    align-items: center;
    width: 33%;
}

.itemselectcars image {
    width: 15rpx;
    height: 15rpx;
    align-self: center;
    margin-left: 5rpx;
}

.red {
    color: #fd6a36;
}

.select_cars,
.select_sort,
.select_price {
    position: fixed;
    top: 92px;
    left: 0px;
    z-index: 888;
    width: 100%;
    padding-left: 30rpx;

    background-color: #fff;
}

.select_cars text,
.select_sort text {
    display: block;
    flex: 1;
    line-height: 35px;
    font-size: 13px;
}

.select_cars text:last-child,
.select_sort text:last-child {
    border-bottom: 0;
}

.select_cars_list {
    display: flex;
    border-bottom: 1px solid #ececec;
}

.select_cars_list image {
    width: 12px;
    height: 22px;
    padding-top: 8px;
    margin-right: 30rpx;
}
.select {
    border-bottom: 1px solid #e62129;
}

.select text {
    color: #e62129;
}

.select_price {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px 4%;
    padding-top: 30rpx;
}
.select_price .item {
    height: 80rpx;
    background: #f3f3f3;
    padding-left: 15rpx;
    padding-right: 15rpx;
    border-radius: 35rpx;
    margin-right: 22rpx;
    margin-bottom: 20rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

/* 遮罩层 */
.small_overlay {
    position: fixed;
    width: 100%;
    height: 80%;
    bottom: 0;
    left: 0;
    z-index: 666;
    background-color: rgba(0, 0, 0, 0.5);
}

.imglabel {
    position: absolute;
    top: -10rpx;
    left: -15rpx;
}

.news {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.guestlist {
    width: 700rpx;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    margin-top: 20rpx;
    border-radius: 5rpx;
    padding: 20rpx;
}
.guestlist .username {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.guestlist .username view:nth-child(1) {
    font-size: 16px;
    font-weight: 600;
}

.guestlist .username view:nth-child(2) {
    font-size: 12px;
}

.guestlist .usertel {
    font-size: 14px;
    margin-top: 20rpx;
}

.guestlist .useraddress {
    font-size: 14px;
    margin-top: 20rpx;
    width: 650rpx;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.guestlist .useraddress view:nth-child(2) {
    font-weight: bold;
    font-size: 14px;
    color: #ff9003;
}
.guestlist .useroper {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.guestlist .useroper view {
    margin-top: 20rpx;
    width: 170rpx;
    height: 50rpx;
    background: #fff;
    border-radius: 10rpx;
    margin-bottom: 20rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    border: 1rpx solid #ff9003;
    color: #ff9003;
    margin-left: 15rpx;
}

.newslist {
    display: flex;
    flex-direction: row;
    width: 650rpx;
    margin: 0 auto;
    margin-bottom: 20rpx;
    background: #fff;
}

.newslist .title {
    width: 100%;
    flex-direction: column;
    display: flex;
    justify-content: space-between;
}

.newslist .title .detail {
    text-align: left;
    font-size: 0.8rem;
    color: #000;
    display: flex;
    flex-direction: row;
    width: 100%;
}

.newslist .title .detail .pic {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.newslist .title .detail .pic image {
    width: 120rpx;
    height: 120rpx;
    align-self: center;
    border-radius: 60rpx;
}
.newslist .title .detail .pic text {
    font-size: 10px;
    color: #646464;
}

.footimg {
    width: 40rpx;
    height: 40rpx;
    position: absolute;
    left: 120rpx;
    right: 0;
    top: 80rpx;
}

.newslist .title .detail .info {
    width: 65%;
}

.newslist .title .detail .info view:nth-child(1) {
    padding-top: 10rpx;
    color: #000;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 15px;
}

.newslist .title .detail .info view:nth-child(2) {
    padding-top: 10rpx;
    padding-bottom: 10rpx;
    color: #646464;
    font-size: 12px;
}

.newslist .title .detail view:nth-child(3) {
    padding-top: 10rpx;
    padding-right: 10rpx;
}
.newslist .title .price {
    width: 28%;
}

.newslist .title .price .money {
    color: #d65408;
    font-weight: bold;
    font-size: 0.7rem;
    padding-right: 10rpx;
}

.jobname > text {
    color: #b7b7b7;
}
.jobmoney {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    color: #646464;
    font-size: 13px;
}

.jobmoney text {
    color: #1296db;
    margin-left: 10rpx;
}
.info .time {
    color: #ff4129;
    font-size: 0.7rem;
}

.nobred {
    border: 1rpx solid #adaaa6;
    color: #adaaa6;
}

.bred {
    border: 1rpx solid #ff9003;
    color: #ff9003;
}
</style>
